package com.example.vbloodbanksalesforce;

import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.util.Log;

import com.example.vbloodbanksalesforce.service.HttpUrlConnectionClass;

public class SplashScreen extends BaseActivity {

	String message;
	HttpUrlConnectionClass httpUrl;

	public void onCreate(Bundle b) {
		super.onCreate(b);

		setContentView(R.layout.activity_splash_screen);
		
		
		httpUrl = new HttpUrlConnectionClass(null);
		httpUrl.attach(this);
		String url ="https://login.salesforce.com/services/oauth2/token?grant_type=password&client_id=3MVG9Y6d_Btp4xp7cR8CojsxTiBr_9UW3fECjHAvBu6.5I8clKBfHxt_ddTSOD7RZJb8LWGEeQDjP2V2GEhRR&client_secret=2708733805985228160&username=chandras.android@gmail.com&password=appshark@321YZnHzzSua71ebszjmJ4ufiez";
		httpUrl.execute(url,"Login");
	}

	
	
	@Override  
	public void apiReturn(String response) {
		
		String  urlResponse =  response;
		Log.i("NCS","Res 1 is   :"+urlResponse);

		if(urlResponse!= null){
			startActivity(new Intent(getApplicationContext(),HomePage.class));
		}
		
		
	}
	/**
	 * Display Frogsaver logo as in LandScape mode
	 */
	@Override
	public void onConfigurationChanged(Configuration newConfig) {

		setContentView(R.layout.activity_splash_screen);
		super.onConfigurationChanged(newConfig);

	}

}
